# This file contains the main loop of the game.
# It pulls in the data files, and calls the necessary functions to run the game.
#
# To Do List:
# - Copy Code from game_functions.get_skill_cards() to do "Turn Actions"
# - Build dummy "Turn Action" functions
# - Create cheat sheat of functions and data structures

from game_functions import *
from game_data import data
(data) = init_game(data)

raw_input('The game is about to begin, press any key to continue!')

# <<<< MAIN LOOP >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

while data['game']['game_end']==False:
    
    display('board',None,{'board':data['board'],'players':data['players']})

    

    #________________________________________
    # PLAYER ACTION PHASE
    # * Current Player prompted to take move / action
    # * Location Options Displayed (Move Action)
    # * Location Action Displayed
    # * Card Actions Displayed
    # * Player Actions Displayed
    # * Process player Move / Action

   # player_action(

    print '\n'
    print data['players'][data['game']['current_player']]['name'],'/',data['players'][data['game']['current_player']]['character'],',  Please choose from the following actions:'
    print 'Current Location:  ', data['players'][data['game']['current_player']]['location']
    valid_choice = False
    while valid_choice == False:
        print '(M)ove, (A)ction, View (L)ocation, View (C)haracter, View Loyalt(Y), View (B)oard'
        choice = raw_input('\nPress Letter to confirm choice, or (V) to view character, or (Y) to view loyalty: ')
        if choice=='M':
            valid_choice = True
            print "move function"

    #________________________________________
    # EVENT CARD PHASE
    # * After player actions / moves, get new event card:
    data['game']['current_event'] = data['event_deck']['deck'].pop()

    for i in data['events'][data['game']['current_event']]['display']:
        None
    #    print i, ':  ', event_data[current_event]['display'][i]

    # * Resolve Event

    # * After event is resolved, move to discard pile:
    data['event_deck']['discard'].append(data['game']['current_event'])

    data['game']['game_end'] = True


    
